/**
* Author: Samfu
* Time  : 上午12:48:46
* Desc  : 
*/
package com.samfu;

import java.util.Date;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

public class TestJob implements Job{
	
	private boolean isRunning=false;

	@Override
	public void execute(JobExecutionContext arg0) throws JobExecutionException {
		if (!isRunning){
			System.out.println(new Date() + " scheduler is running....");
			for (int i=0; i<100; i++) {
				System.out.println("Running " + (1+i) + " ....");
				try {
					Thread.sleep(100);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		} else {
			System.out.println(new Date() + " scheduler is not running...");
		}
	}

}
